package pl.PawelAndAlicja.badugiproject.main.Cards;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class ClientDeckTest {

    private ClientDeck clientDeck = null;
    private FlyweightFactoryCard factoryCard = null;

    @Before
    public void setUp() throws Exception {
        factoryCard = new FlyweightFactoryCard();
        clientDeck = new ClientDeck(factoryCard);
    }

    @After
    public void tearDown() throws Exception {
        clientDeck = null;
        factoryCard = null;
    }

    @Test
    public void testCreateCardSpadeType() throws Exception {
        FlyweightCard flyweightCard = clientDeck.createCard("Spade", "Ace");
        assertEquals("Should be Spade Ace card", flyweightCard.getType(), clientDeck.createCard("Spade", "Ace").getType());
    }

    @Test
    public void testCreateCardSpadeName() throws Exception {
        FlyweightCard flyweightCard = new FlyweightSpadeCard("Ace");
        assertEquals("Should be Spade Ace card", flyweightCard.getName(), clientDeck.createCard("Spade", "Ace").getName());
    }

    @Test
    public void testCreateCardSpadePower() throws Exception {
        FlyweightCard flyweightCard = new FlyweightSpadeCard("Ace");
        assertEquals("Should be Spade Ace card", flyweightCard.getPower(), clientDeck.createCard("Spade", "Ace").getPower());
    }

//    @Test
//    public void testCreateCardIsNull() throws Exception {
//        FlyweightCard flyweightCard = null;
//        assertNull(flyweightCard);
//    }

    @Test
    public void testCreateCardIsNotNull() throws Exception {
        FlyweightCard flyweightCard = clientDeck.createCard("Spade", 5);
        assertNotNull(flyweightCard);
    }

    @Test
    public void testCreateDeck() throws Exception {
        clientDeck.createDeck();
        assertEquals(clientDeck.createCard("Spade", "Ace"), clientDeck.createCard("Spade", "Ace"));
    }

//    @Test
//    public void testReplaceFewCards() throws Exception {
//
//    }
//
//    @Test
//    public void testShuffleDeck() throws Exception {
//    }
}